<?php
include '../../DB/dbConnection.php';

$final=array();
	
$stmt = $conn->prepare("SELECT * FROM contact_us");
$success = $stmt->execute();
$stmt->bind_result($id, $name, $school, $email, $contact, $city, $state, $subject, $message);

while ($stmt->fetch()) {
		$tmp=array();
		$tmp['id']=$id;
		$tmp['name']=$name;
		$tmp['school']=$school;
		$tmp['email']=$email;
		$tmp['contact']=$contact;
		$tmp['city']=$city;
		$tmp['state']=$state;
		$tmp['subject']=$subject;
		$tmp['message']=$message;
		
		array_push($final,$tmp);
}

	$result=array();

	if($success)
	{
		$result['error']='false';
		$result['list']=$final;
	}
	else
		$result['error']='true';
		
	echo json_encode($result);
?>
